package com.gaoyi.basemodule.baseUtil;

import com.gaoyi.basemodule.basedialog.BaseFragmentDialog;

public class DialogUtils {
    /**
     * 当dialog只是隐藏时，避免跳转后重新返回会show dialog
     */
    public static void onPauseDialog(BaseFragmentDialog<?> dialog) {
        if (dialog != null && !dialog.isShowing()) {
            dialog.dismissAllowingStateLoss();
        }
    }

    public static void onPauseDialog(BaseFragmentDialog<?>... dialogs) {
        for (BaseFragmentDialog<?> dialog : dialogs) {
            onPauseDialog(dialog);
        }
    }
}
